package com.jinxin.platform.cdacsrecord.core.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jinxin.platform.cdacsrecord.core.mapper.JurenAcsCommunityInfoMapper;
import com.jinxin.platform.cdacsrecord.core.pojo.domains.JurenAcsCommunityInfo;
import com.jinxin.platform.cdacsrecord.core.service.JurenAcsCommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2020-07-17
 * @Author: Lingnan
 **/
@Service
public class JurenAcsCommunityServiceImpl implements JurenAcsCommunityService {

    @Autowired
    private JurenAcsCommunityInfoMapper acsCommunityInfoMapper;


    @Override
    public int insert(JurenAcsCommunityInfo acsCommunityInfo) {
        return acsCommunityInfoMapper.insert(acsCommunityInfo);
    }

    @Override
    public int updateByKey(JurenAcsCommunityInfo acsCommunityInfo) {
        return acsCommunityInfoMapper.updateByKey(acsCommunityInfo);
    }

    @Override
    public JurenAcsCommunityInfo selectByKey(String companyId) {
        return acsCommunityInfoMapper.selectByKey(companyId);
    }

    @Override
    public JurenAcsCommunityInfo selectOne(HashMap param) {
        return acsCommunityInfoMapper.selectOne(param);
    }

    @Override
    public List<JurenAcsCommunityInfo> list(HashMap param) {
        return acsCommunityInfoMapper.list(param);
    }

    @Override
    public List listCommunities() {
        return acsCommunityInfoMapper.listCommunities();
    }

    @Override
    public PageInfo<JurenAcsCommunityInfo> listPage(int page, int size,HashMap param) {
        PageHelper.startPage(page,size);
        List<JurenAcsCommunityInfo> infoList = acsCommunityInfoMapper.list(param);
        PageInfo<JurenAcsCommunityInfo> pageInfo = new PageInfo<>(infoList);
        return pageInfo;
    }

    @Override
    public int deleteByKey(String companyId) {
        return acsCommunityInfoMapper.deleteByKey(companyId);
    }

    @Override
    public int remove(HashMap param) {
        return acsCommunityInfoMapper.remove(param);
    }
}
